﻿using System;
using System.Configuration;

namespace Rarous.TexyNet.Configuration {
  /// <summary>
  /// 
  /// </summary>
  public class BlockModuleElement : ConfigurationElement {
    #region Constructors
    /// <summary>
    /// Konstruktor
    /// </summary>
    public BlockModuleElement() {
    }
    #endregion

    #region Properties
    /// <summary>
    /// 
    /// </summary>
    [ConfigurationProperty("allowedPre", IsRequired = false, DefaultValue = true)]
    public bool AllowedPre {
      get {
        return Convert.ToBoolean(this["allowedPre"]);
      }
      set {
        this["allowedPre"] = value;
      }
    }

    /// <summary>
    /// 
    /// </summary>
    [ConfigurationProperty("allowedText", IsRequired = false, DefaultValue = true)]
    public bool AllowedText {
      get {
        return Convert.ToBoolean(this["allowedText"]);
      }
      set {
        this["allowedText"] = value;
      }
    }

    /// <summary>
    /// 
    /// </summary>
    [ConfigurationProperty("allowedHtml", IsRequired = false, DefaultValue = true)]
    public bool AllowedHtml {
      get {
        return Convert.ToBoolean(this["allowedHtml"]);
      }
      set {
        this["allowedHtml"] = value;
      }
    }
    #endregion

    #region Override Methods
    /// <summary>
    /// Nastavuje výchozí hodnoty
    /// </summary>
    protected override void InitializeDefault() {
      base.InitializeDefault();
      AllowedHtml = true;
      AllowedPre = true;
      AllowedText = true;
    }
    #endregion
  }
}
